import request from "../../utils/request";
import { getUser } from "../admin/User";

export function addOrder(payTotal, type) {
    return request({
        url: `/user/Order/pay/${type}`,
        method: 'post',
        data: payTotal
    })
}

export function getList() {
    return request({
        url: '/user/Order/userGetList',
        method: 'get'
    })
}
export function getOrderById(orderId) {
    return request({
        url: '/user/Order/checkOrder',
        method: 'get',
        params: { id: orderId }
    })
}
export function getOrderDetail(orderId) {
    return request({
        url: '/user/orderHistory/getOrderDetail',
        method: 'get',
        params: { orderId: orderId }
    })
}
export function confirmReceipt(orderId) {
    return request({
        url: '/user/Order/confirmReceipt',
        method: 'put',
        params: { orderId: orderId }
    })
}



// 生成支付二维码
export function generatePaymentQrCode(data) {
    return request({
        url: '/order/generateQrCode',
        method: 'post',
        data
    });
}
//查看物流
export function showLogistics(orderId) {
    return request({
        url: '/user/Order/showLogistics',
        method: 'get',
        params: {
            orderId: orderId
        }
    });
}